home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-25 | 1.5 KB | 45 lines | [TEXT/GEOL] |
- Item 3174699 24-May-90 18:04PDT
-
- From: S.FRIEDRICH Friedrich, Steve
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: re> assignment to ivars
-
- >On page 331 of "Programming with MacApp" it says not to do this:
-
- > fMyInstanceVariable := FunctionThatMayMoveMemory;
-
- >because the address fMyInstanceVariable^^ is computed before the function is
- >called. Is this correct??? If so, then I'll have to check a bunch of things in
- >my code. Does the code of MacApp really never use such statements?
-
- #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
- PLEASE NOTE!!!
- #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
-
- fMyInstanceVariable := FunctionThatMayMoveMemoryORBeInAnotherSegment;
-
- is perfectly acceptable!
- is perfectly acceptable!
- is perfectly acceptable!
- However,
-
- FunctionThatMayMoveMemoryORBeInAnotherSegment(fMyInstanceVariable); {where
- parameter is VAR}
-
- is not acceptable because VAR parameters require that the address be taken at
- the time the call is made.
-
- FunctionThatMayMoveMemoryORBeInAnotherSegment(fMyInstanceVariable); {where
- parameter is VAR or not _AND_ fMyInstanceVariable is greater than 4 bytes in
- size}
-
- may not be acceptable because VAR parameters require that the address be taken
- at the time the call is made _AND_ greater than 4 byte parameters are copied
- into the callee's stack frame when they are passed by value.
-
- Regards,
- Steve
-
-